import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import list from '../views/home_list.vue'
import login from '../views/login.vue'
import detail from '../views/detail.vue'
import theme from '../views/theme.vue'


const routes = [{
    path: '/',
    redirect: '/home/list'
  },
  {
    path: '/home',
    component: Home,
    children: [{
        path: '/home/list',
        name: "homelist",
        component: list
      },
      {
        path: '/home/login',
        name: 'homeLogin',
        component: login
      }
    ]
  },
  {
    path: '/detail',
    name: "detail",
    component: detail
  },
  { //登录
    path: '/deng',
    name: 'deng',
    component: () => import('../views/denglu.vue')
  },
  { //未读消息
    path: '/info',
    name: 'info',
    component: () => import('../views/user_list/info.vue')
  },
  { //个人信息
    path: '/myuser',
    name: 'myuser',
    component: () => import('../views/user_list/user.vue')
  },
  { //收藏
    path: '/collect',
    name: 'collect',
    component: () => import('../views/user_list/collect.vue')
  },
  {
    path: '/theme',
    name: 'theme',
    component: theme
  }
]
Vue.use(VueRouter)

const router = new VueRouter({
  mode: 'history',
  base: '/cnode/',
  routes
})

export default router